package com.mvc.business.model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;

@Entity(name = "B_ORDER_ASSOCIATED")
@IdClass(OrderAssociatedPK.class)
public class OrderAssociated implements Serializable {
	public static final int	TYPE_PACKING	        = 1;
	public static final int	TYPE_COMMERCIAL_INVOICE	= 2;
	public static final int	TYPE_BANK_STATEMENT	    = 3;

	@Id
	private Integer	        associatedId;
	@Id
	private Integer	        orderId;
	@Id
	private Integer	        type;

	public Integer getOrderId() {
		return orderId;
	}

	public void setOrderId(Integer orderId) {
		this.orderId = orderId;
	}

	public Integer getAssociatedId() {
		return associatedId;
	}

	public void setAssociatedId(Integer associatedId) {
		this.associatedId = associatedId;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}
}

class OrderAssociatedPK implements Serializable {

	private Integer	orderId;
	private Integer	associatedId;
	private Integer	type;

	public Integer getOrderId() {
		return orderId;
	}

	public void setOrderId(Integer orderId) {
		this.orderId = orderId;
	}

	public Integer getAssociatedId() {
		return associatedId;
	}

	public void setAssociatedId(Integer associatedId) {
		this.associatedId = associatedId;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

}
